package decoratorPattern;

public class Client {

    /**
     * 装饰器模式
     * @param args
     */
    public static void main(String[] args) {
        // 炒饭
        FastFood firedRice = new FiredRice();
        System.out.println(firedRice.getDesc() + " " + firedRice.cost());

        // 加蛋
        Egg firedRiceWithEgg = new Egg(firedRice);
        System.out.println(firedRiceWithEgg.getDesc() + " "+ firedRiceWithEgg.cost());

        // 加培根
        Bacon bacon = new Bacon(firedRiceWithEgg);
        System.out.println(bacon.getDesc() + " " + bacon.cost());

    }
}
